#
#
#
#
#

CC=arm-linux-gcc#
LD=arm-linux-ld#
AR=arm-linux-ar#
LDFLAGS=-g
ARFLAGS=-r
CFLAGS=-I ../../srl_include -I ../../srl_include/comm -I ../../srl_include/drv -I ../../srl_include/head -I ../../srl_include/int -I ../../srl_include/kernel

vpath %.h ../../srl_include
vpath %.h ../../srl_include/comm
vpath %.h ../../srl_include/drv
vpath %.h ../../srl_include/head
vpath %.h ../../srl_include/int
vpath %.h ../../srl_include/kernel

COMM_TAG=k_comm.a# use static library
COMM_OBJ=comm.o timer.o
COMM_SRC=$(COMM_OBJ:.o=.c)
COMM_DEP=$(COMM_OBJ:.o=.d)

$(COMM_TAG):$(COMM_OBJ) $(COMM_DEP)
	$(AR) $(ARFLAGS) $@ $(COMM_OBJ)

dep:$(COMM_DEP)
$(COMM_DEP):%.d:%.c
	rm -f $*.d;\
	gcc $(CFLAGS) -MM $<|sed 's,^.*:,$*.o:,' >log.$$$$1;\
	echo $(CC) $(CFLAGS) -c $< -o $*.o >log.$$$$2;\
	cat log.$$$$1 log.$$$$2|sed 's/^$(CC)/\t$(CC)/g' >$@;\
	rm -f log.$$$$*;\

include $(COMM_OBJ:.o=.d)

clean:
	rm -f $(COMM_DEP) $(COMM_OBJ) $(COMM_TAG)
